<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
    <xsl:output method="html" indent="yes"/>
    <xsl:template match="/">
        
        <xsl:choose>
            <xsl:when test="count(//category) = 0">
               Pas de catégorie de produits !!
            </xsl:when>
            <xsl:otherwise>

                <table class="listeComptes">
                    <tr>
                        <td>
                            <b>Nom catégorie</b>
                        </td>
                        <td>
                            <b>Actions</b>
                        </td>
                    </tr>

                    <xsl:for-each select="//category">
                        <tr>
                            <td>
                                <xsl:value-of select="." />
                            </td>
                            <td>
                                <a style="padding:9px;" href="{concat('../secured/CategoryMgt.do?id=', @id)}">
                                    <img border="0" src="../images/edit.gif"></img>
                                </a>
                                <a style="padding:9px;" href="{concat('../secured/RemoveCategory.do?id=', @id)}">
                                    <img border="0" src="../images/delete.gif"></img>
                                </a>
                            </td>
                        </tr>
                    </xsl:for-each>
                </table>
            </xsl:otherwise>
        </xsl:choose>

    </xsl:template>
</xsl:stylesheet>